/*
* // +-------------------------------------------------------------------------------------------------
* // |                 有你就好 [ 有节骨乃坚，无心品自端 ]     <http://encoding.wang>
* // +-------------------------------------------------------------------------------------------------
* // |                             独在异乡为异客         每逢佳节倍思亲
* // +-------------------------------------------------------------------------------------------------
* // |                 联系:   <707069100@qq.com>      <http://weibo.com/513778937>
* // +-------------------------------------------------------------------------------------------------
*/

// -----------------------------------------------------------------------------------------------------
// +----------------------------------------------------------------------------------------------------
// |                   ErYang出品 属于小极品          共同学习    共同进步
// +----------------------------------------------------------------------------------------------------
// -----------------------------------------------------------------------------------------------------


package wang.encoding.mroot.service.system


import wang.encoding.mroot.common.business.ResultData
import wang.encoding.mroot.common.service.BaseService
import wang.encoding.mroot.model.entity.system.User
import java.math.BigInteger

/**
 * 用户 service
 *
 * @author ErYang
 */
interface UserService : BaseService<User> {

    /**
     * 初始化新增 User 对象
     *
     * @param user User
     * @return User
     */
    fun initSaveUser(user: User): User

    // -------------------------------------------------------------------------------------------------

    /**
     * 初始化修改 User 对象
     *
     * @param user User
     * @return User
     */
    fun initEditUser(user: User): User

    // -------------------------------------------------------------------------------------------------

    /**
     * Hibernate Validation 验证
     */
    fun validationUser(user: User): String?

    // -------------------------------------------------------------------------------------------------

    /**
     * 根据用户名查询 user
     *
     * @param username 用户名
     * @return User
     */
    fun getByUsername(username: String): User?

    // -------------------------------------------------------------------------------------------------

    /**
     * 根据昵称查询 user
     *
     * @param nickName 昵称
     * @return User
     */
    fun getByNickName(nickName: String): User?

    // -------------------------------------------------------------------------------------------------

    /**
     * 根据电子邮箱查询 user
     *
     * @param email 用户名
     * @return User
     */
    fun getByEmail(email: String): User?

    // -------------------------------------------------------------------------------------------------

    /**
     * 根据手机号码查询 user
     *
     * @param phone 用户名
     * @return User
     */
    fun getByPhone(phone: String): User?

    // -------------------------------------------------------------------------------------------------

    /**
     * 根据用户名和密码查询 user
     *
     * @param username 用户名
     * @param password 密码
     * @return User
     */
    fun getByUsernameAndPassword(username: String, password: String): User?

    // -------------------------------------------------------------------------------------------------

    /**
     * 新增用户
     *
     * @param user User
     * @return 用户ID  BigInteger
     */
    fun saveBackId(user: User): BigInteger?

    // -------------------------------------------------------------------------------------------------

    /**
     * 更新用户
     *
     * @param user User
     * @return 用户ID  BigInteger
     */
    fun updateBackId(user: User): BigInteger?

    // -------------------------------------------------------------------------------------------------

    /**
     * 删除用户(更新状态)
     *
     * @param id BigInteger
     * @return 用户ID  BigInteger
     */
    fun removeBackId(id: BigInteger): BigInteger?

    // -------------------------------------------------------------------------------------------------

    /**
     * 恢复用户(更新状态)
     *
     * @param id BigInteger
     * @return 用户ID  BigInteger
     */
    fun recoverBackId(id: BigInteger): BigInteger?

    // -------------------------------------------------------------------------------------------------

    /**
     * 登录
     *
     * @param username 用户名
     * @param password 密码
     * @return ResultData
     */
    fun login(username: String, password: String): ResultData

    // -------------------------------------------------------------------------------------------------

    /**
     * 根据查询字段查询 list 结果集
     *
     * @param columnArray 查询字段集合
     *
     * @return List<T>
     */
    fun list(id: BigInteger, columnArray: Array<String>? = null): List<User>?

    // -------------------------------------------------------------------------------------------------

    /**
     * 数据加密
     *
     * @param user         用户
     * @return User
     */
    fun aseEncryptData(user: User): User

    // -------------------------------------------------------------------------------------------------

    /**
     * 数据解密
     *
     * @param user         用户
     * @return User
     */
    fun aseDecryptData(user: User): User

    // -------------------------------------------------------------------------------------------------

}

// -----------------------------------------------------------------------------------------------------

// End UserService class

/* End of file IUserService.kt */
/* Location: ./src/main/kotlin/wang/encoding/mroot/service/system/UserService.kt */

// -----------------------------------------------------------------------------------------------------
// +----------------------------------------------------------------------------------------------------
// |                           ErYang出品 属于小极品  O(∩_∩)O~~   共同学习    共同进步
// +----------------------------------------------------------------------------------------------------
// -----------------------------------------------------------------------------------------------------
